package com.isoft.illustrationsdraw.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft.illustrationsdraw.entity.LikeIllustration;
import com.isoft.illustrationsdraw.mapper.LikeIllustrationMapper;
import com.isoft.illustrationsdraw.service.LikeIllustrationService;
import org.springframework.stereotype.Service;

@Service
public class LikeIllustrationServiceImpl extends ServiceImpl<LikeIllustrationMapper, LikeIllustration> implements LikeIllustrationService {

    @Override
    public LikeIllustration findLikeIllustration(Long userId, Long illustrationId) {
        QueryWrapper<LikeIllustration> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id", userId).eq("illustration_id", illustrationId);
        return getOne(queryWrapper);
    }

}
